package com.example.kai.uno.uno;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

public class Card {


	int poke;
	Bitmap pokeImage;
	int personID;


	public Card(int poke,Bitmap pokeImage,int id)
	{
		this.personID=id;
		this.poke=poke;
		this.pokeImage=pokeImage;


	}
	
	public void paint(Canvas canvas,int left,int top,int dir)
	{
		Rect src = new Rect();
		Rect des = new Rect();

			int row = Poke.getImageRow(poke);
			int col = Poke.getImageCol(poke);
			if (dir == PokeType.dirV) {
				row = Poke.getImageRow(poke);
				col = Poke.getImageCol(poke);
				src.set(col * 35, row * 52, col * 35 + 35, row * 52 + 52);
				des.set(left, top , left + 35, top + 52 );
			} else {
				row = Poke.getImageRow(poke);
				col = Poke.getImageCol(poke);
				int select = 0;
				src.set(col * 35, row * 52, col * 35 + 35, row * 52 + 52);
				des.set(left , top - select, left + 35 , top
						- select + 52);
			}
			canvas.drawBitmap(pokeImage, src, des, null);
		}





}
